#pragma once 

#include <string>
#include "server/rtmp/amf0/amf0_inc.hpp"
#include "server/rtmp/rtmp_protocol/rtmp_define.hpp"
#include "rtmp_create_stream_message.hpp"

namespace mms{

class RtmpCreateStreamRespMessage{

public:
    RtmpCreateStreamRespMessage(const RtmpCreateStreamMessage &rel_msg, const std::string &name)
    {
        command_name_.set_value(name);
        transaction_id_.set_value(rel_msg.transaction_id_.get_value());
        stream_id_.set_value(1);
    }

    RtmpCreateStreamRespMessage()
    {
    }

    RtmpCreateStreamRespMessage(int32_t transaction_id);

    virtual ~RtmpCreateStreamRespMessage()
    {
    }

    double get_stream_id();

public:
    int32_t decode(std::shared_ptr<RtmpMessage> rtmp_msg);
    std::shared_ptr<RtmpMessage> encode();
    Amf0Null &cmdObj()
    {
        return command_obj_;
    }

private:
    Amf0String command_name_;
    Amf0Number transaction_id_;
    Amf0Null command_obj_;
    Amf0Number stream_id_;
};


}